﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using CarolLib.Extension;

namespace CarolLib.Control
{
    public class MdiUserControl : UserControl, ICloneable
    {
        #region Properties

        private string caption = "No Name";
        public string Caption
        {
            get { return caption; }
            set { caption = value; }
        }

        private string category = "No Category";
        public string Category
        {
            get { return category; }
            set { category = value; }
        }

        private int imageIndex = 0;
        public int ImageIndex
        {
            get { return imageIndex; }
            set { imageIndex = value; }
        }

        private Guid moduleID;

        public Guid ModuleID
        {
            get { return moduleID; }
            set { moduleID = value; }
        }

        #endregion

        #region Ctor.

        public MdiUserControl()
            : base()
        {
        }

        public MdiUserControl(XmlNode node)
        {
            this.Caption = node.GetStringAttribute("caption", caption);
        }

        #endregion

        public virtual void Unload() { }

        public virtual void Onload() { }

        public virtual bool CommonFun() { return false; }


        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
